export interface scmGoodsData {
  category?: string;
  timeCategory?: string;
  goods_no?: string;
  status?: number;
  erp_status?: number;
  goods_name?: string;
  goods_images?: string;
  color?: string;
  template?: {
    template_no?: string;
  };
  sale_price?: number;
  tag_price?: number;
  purchase_price?: number;
  distribution_price?: number;
  cate_name?: string;
  style_cate_name?: string;
  time_cate_name?: string;
  merchandiser?: string;
  buyer?: string;
  attr_fabric?: string;
  attr_lining?: string;
  attr_process_fabric?: string;
  attr_process_lining?: string;
  push_time?: string;
  updateAdmin?: {
    realname?: string;
  };
  createAdmin?: {
    realname?: string;
  };
  updated_at?: string;
  created_at?: string; // 创建时间，可按需要改成 Date
}

export const scmGoodColumns: any = [
  {
    type: 'checkbox', // 多选列（自带全选框）
    width: 50, // 列宽
    align: 'center', // 居中
    fixed: 'left', // 固定在最左侧
    title: '', // 表头文字
  },
  { field: 'goods_no', sortable: true, title: '货号', width: 120 },
  { title: '货品分类', field: 'category', width: 50, visible: false },
  { field: 'timeCategory', sortable: true, title: '货品波段', visible: false },
  {
    field: 'status',
    sortable: true,
    title: '状态',
    width: 70,
    cellRender: {
      name: 'CellTag',
      options: [
        {
          color: 'success',
          label: '启用',
          value: 1,
        },
        { color: 'error', label: '禁用', value: 0 },
      ],
    },
  },
  {
    field: 'erp_status',
    sortable: true,
    title: '同步',
    width: 70,
    cellRender: {
      name: 'CellTag',
      options: [
        {
          color: 'success',
          label: '已同步',
          value: 1,
        },
        { color: 'error', label: '待同步', value: 0 },
      ],
    },
  },
  {
    title: '品名',
    field: 'goods_name',
    sortable: false,
    width: 140,
  },
  {
    field: 'goods_images',
    title: '图片',
    width: 50,
    slots: { default: 'imgs' },
  },

  { title: '颜色', field: 'color.name', width: 100 },
  { title: '颜色编码', field: 'color.code', width: 100 },
  { title: '简码', field: 'template.template_no', width: 100 },
  { title: '零售价', field: 'sale_price', sortable: true, width: 100 },
  { title: '吊牌价', field: 'tag_price', sortable: true, width: 100 },
  { title: '采购价', field: 'purchase_price', sortable: true, width: 100 },
  {
    title: '分销价',
    field: 'distribution_price',
    sortable: true,
    width: 100,
  },
  { title: '款式分类', field: 'cate_name', sortable: false, width: 200 },
  {
    title: '风格分类',
    field: 'style_cate_name',
    sortable: false,
    width: 200,
  },
  { title: '时间分类', field: 'time_cate_name', sortable: false, width: 200 },
  { title: '跟单', field: 'merchandiser', sortable: false, width: 110 },
  { title: '买手', field: 'buyer', sortable: false, width: 110 },
  { title: '面料', field: 'attr_fabric', sortable: false, width: 110 },
  { title: '里料', field: 'attr_lining', sortable: false, width: 110 },
  {
    title: '加工面料',
    field: 'attr_process_fabric',
    sortable: false,
    width: 110,
  },
  {
    title: '加工里料',
    field: 'attr_process_lining',
    sortable: false,
    width: 110,
  },
  { title: '同步时间', field: 'push_time', sortable: false, width: 110 },
  {
    title: '修改人',
    field: 'updateAdmin.realname',
    sortable: false,
    width: 110,
  },
  {
    title: '创建人',
    field: 'createAdmin.realname',
    sortable: false,
    width: 110,
  },
  { title: '修改时间', field: 'updated_at', sortable: false, width: 110 },
  { title: '创建时间', field: 'created_at', sortable: false, width: 110 },
  {
    field: 'action',
    title: '操作',
    fixed: 'right',
    width: 250,
    slots: { default: 'action' },
  },
] as const;
